Optimal. Leaf size=15 \[ -\frac {\tanh ^{-1}(\sin (x))}{a}+\frac {\tan (x)}{a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {2785, 3852, 8,
3855} \begin {gather*} \frac {\tan (x)}{a}-\frac {\tanh ^{-1}(\sin (x))}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2785
Rule 3852
Rule 3855
Rubi steps
\begin {align*} \int \frac {\tan ^2(x)}{a+a \cos (x)} \, dx &=-\frac {\int \sec (x) \, dx}{a}+\frac {\int \sec ^2(x) \, dx}{a}\\ &=-\frac {\tanh ^{-1}(\sin (x))}{a}-\frac {\text {Subst}(\int 1 \, dx,x,-\tan (x))}{a}\\ &=-\frac {\tanh ^{-1}(\sin (x))}{a}+\frac {\tan (x)}{a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(39\) vs. \(2(15)=30\).
time = 0.08, size = 39, normalized size = 2.60 \begin {gather*} \frac {\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\tan (x)}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(44\) vs.
\(2(15)=30\).
time = 0.08, size = 45, normalized size = 3.00
method | result | size |
risch | \(\frac {2 i}{a \left ({\mathrm e}^{2 i x}+1\right )}-\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{a}+\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{a}\) | \(44\) |
default | \(\frac {-\frac {1}{\tan \left (\frac {x}{2}\right )-1}+\ln \left (\tan \left (\frac {x}{2}\right )-1\right )-\frac {1}{\tan \left (\frac {x}{2}\right )+1}-\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{a}\) | \(45\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 61 vs.
\(2 (15) = 30\).
time = 0.27, size = 61, normalized size = 4.07 \begin {gather*} -\frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right )}{a} + \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right )}{a} + \frac {2 \, \sin \left (x\right )}{{\left (a - \frac {a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (x\right ) + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 33 vs.
\(2 (15) = 30\).
time = 0.40, size = 33, normalized size = 2.20 \begin {gather*} -\frac {\cos \left (x\right ) \log \left (\sin \left (x\right ) + 1\right ) - \cos \left (x\right ) \log \left (-\sin \left (x\right ) + 1\right ) - 2 \, \sin \left (x\right )}{2 \, a \cos \left (x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\tan ^{2}{\left (x \right )}}{\cos {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 45 vs.
\(2 (15) = 30\).
time = 0.45, size = 45, normalized size = 3.00 \begin {gather*} -\frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) + 1 \right |}\right )}{a} + \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) - 1 \right |}\right )}{a} - \frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{{\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )} a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.35, size = 30, normalized size = 2.00 \begin {gather*} -\frac {2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a}-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{a\,\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________